<?php
/*
Copyright (C) 2009 de Flotte Maxence

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
?>
<?php
/*
 *	Test de script puZZle
 *
*/

include_once './ZzO/std/Boot.php';
include_once './ZzO/std/Main.php';
include_once './ZzL/Conf.php';
include_once './ZzL/Right.php';
include './ZzL/genZzS.php';
session_start();
//error_reporting(0);
?>
<form method="post">
<textarea name="ZzS" style="width: 500px; height: 200px;">
<?php
  if(isSet($_SESSION['ZzS']) and !isSet($_POST['ZzS'])) {
    $_POST['ZzS'] = $_SESSION['ZzS'];
  }
$_POST['ZzS'] = stripslashes($_POST['ZzS']);
  echo $_POST['ZzS'];

?>
</textarea><br/>
<input type="submit" value="exécuter"/>
<input type="submit" name="delCache" value="exécuter et vider le cache" />
</form>
<?php
$GLOBALS['MySql'] = new mysqli($GLOBALS['Serveur'], $GLOBALS['Login'], $GLOBALS['PassWord'], $GLOBALS['DB']);
?>
<div style="border: solid black 1px; margin:10px; padding: 5px;">
<?php
if($_SESSION['ZzS']==$_POST['ZzS'] and !isSet($_POST['delCache'])) {
  if(file_exists('./ZzG/testPuZZle.php'))
    include './ZzG/testPuZZle.php';
  else
    genZzG2($_POST['ZzS'],'testPuZZle');
}
else
  genZzG2($_POST['ZzS'],'testPuZZle');
$_SESSION['ZzS']=$_POST['ZzS'];
?>
</div>
<?php
echo '<div style="border: solid black 1px; margin:10px; padding: 5px;"><pre>'.createStaticpuZZle2($_POST['ZzS']).'</pre></div>';


?>